import Vue from 'vue'
import App from './App.vue'
import router from './router'
import qs from 'qs'
import './plugins/element.js'
import './assets/css/global.css'
import './assets/fonts/iconfont.css'
import axios from 'axios'
// import Video from 'video.js'
// import 'video.js/dist/video-js.css'
// import VideoPlayer from 'vue-video-player'
// import 'vue-video-player/src/custom-theme.css'
import globalData from './assets/js/global.data.js'
// 加载时候上面的进度条,导入NProgress 对应的js和css
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
// Vue.use(VideoPlayer)

import store from '../src/store/index'

// Vue.prototype.$video = Video
Vue.prototype.GLOBAL = globalData
Vue.use(globalData)
// require('video.js/dist/video-js.css')
// require('vue-video-player/src/custom-theme.css')

// 可以跨域设置
axios.defaults.withCredentials = true
axios.defaults.timeout = 2000
// axios 请求拦截器，request拦截器中显示进度条
axios.interceptors.request.use((config) => {
  NProgress.start()
  return config
})

// 在response拦截器中隐藏进度条
axios.interceptors.response.use((config) => {
  NProgress.done()
  return config
})

Vue.prototype.$axios = axios
Vue.prototype.$qs = qs

Vue.config.productionTip = false

new Vue({
  router,
  render: (h) => h(App),
  beforeCreate() {
    Vue.prototype.$bus = this
  },
  store
}).$mount('#app')
